library ieee;
use ieee.std_logic_1164.all;
library work;

package package_settings is
	constant SIZE_ADC_SAMPLES                   : integer := 6;
	constant SIZE_FLAG                          : integer := 2;
	constant SIZE_TST                           : integer := 7;
	constant SIZE_DELAY                         : integer := 7;
	constant SIZE_ADC_DATA                      : integer := 11;
	constant SIZE_FILTER_DATA                   : integer := 15;
	constant kTrapez                            : integer := 25;--10;--10;
	constant lTrapez                            : integer := 14;--5;--10;
	constant MTrapez                            : integer := 75;--75;--16;
	constant kTriang                            : integer := 27;--8;--15;
	constant lTriang                            : integer := 27;--8;--15;
	constant MTriang                            : integer := 16;--16;
--	constant DataShiftFilter                    : integer := 20;
	constant lModifiedCusp                      : integer := 5;
	constant kModifiedCusp                      : integer := 11;
	constant m1ModifiedCusp                     : integer := 16;
	constant m2ModifiedCusp                     : integer := 1;
	constant SIZE_COUNTER_PILE_UP_TIME          : integer := 8;
	constant SIZE_SPI_CS                        : integer := 2;
	constant SIZE_RAM_ADDRESS                   : integer := 11;
	constant SIZE_RAM_INPUT                     : integer := 31;
	constant SIZE_REGISTER                      : integer := 15;
	constant NUMBER_REGISTER                    : integer := 127;
	constant SIZE_TIME_COUNTER                  : integer := 15;
	constant SIZE_COUNTER_WR                    : integer := 3;
	constant SIZE_TIME_WINDOW                   : integer := 4;
	constant SIZE_COUNTER_EVENT                 : integer := 31;
	constant SIZE_FILTER_CONSTANT               : integer := 7;
	constant SIZE_CONVOL_LENGTH                 : integer := 19;
	constant SIZE_GAIN_BIAS                     : integer := 11;
	constant SIZE_BIT_COUNTER                   : integer := 5;
	constant SIZE_REG_DATA                      : integer := 7;
	constant SIZE_BIT                           : integer := 15;
	constant SIZE_TEST_RAM_ADDR                 : integer := 6;
	constant SIZE_TEST_COUNTER                  : integer := 15;
	constant SIZE_START_REG_LATCH               : integer := 3;
	constant SIZE_CONVOL_SUM                    : integer := 18;
	constant SIZE_RAM_BUF_ADDR                  : integer := 12;
	constant SIZE_ADC_SETTINGS                  : integer := 15;
	constant SIZE_COUNTER_MESURE_ZERO           : integer := 8;
	constant timeCounterMesureZero              : integer := 254;
	constant SIZE_MULT_DATA                     : integer := 31;
	constant SIZE_LATCH_PROCESS                 : integer := 4;
	constant SIZE_TIME_WINDOW_WAVEFORM          : integer := 10;
	constant SIZE_DATA_RAM_BUFFER_LATE          : integer := 2;
	constant SIZE_TIME_WINDOW_NEUTRON           : integer := 31;

	subtype convol_width is std_logic_vector(SIZE_REGISTER downto 0);
	type convol_length is array (SIZE_CONVOL_LENGTH downto 0) of convol_width;

	subtype counter_ram_addr_late_width         is std_logic_vector(SIZE_RAM_ADDRESS-1 downto 0);
	type counter_ram_addr_late_length           is array (SIZE_DATA_RAM_BUFFER_LATE downto 0) of counter_ram_addr_late_width;

	subtype data_latch_width                    is std_logic_vector(SIZE_FILTER_DATA downto 0);
	type data_latch_length                      is array (5 downto 0) of data_latch_width;

--	subtype shift_reg_input_sig_width_trapez    is std_logic_vector((SIZE_FILTER_DATA + 1) downto 0);
--	type shift_reg_input_sig_length_trapez      is array ((kTrapez+lTrapez) downto 0) of shift_reg_input_sig_width_trapez;

	subtype shift_reg_input_sig_width_trapez    is std_logic_vector(SIZE_FILTER_DATA+7 downto 0);
	type shift_reg_input_sig_length_trapez      is array ((kTrapez+lTrapez) downto 0) of shift_reg_input_sig_width_trapez;

	subtype shift_reg_input_sig_width_triang    is std_logic_vector(SIZE_FILTER_DATA+7 downto 0);
	type shift_reg_input_sig_length_triang      is array ((kTriang+lTriang) downto 0) of shift_reg_input_sig_width_triang;

	subtype shift_reg_input_sig_width_mod_cusp  is std_logic_vector((SIZE_FILTER_DATA+7) downto 0);
	type shift_reg_input_sig_length_mod_cusp    is array (kModifiedCusp downto 0) of shift_reg_input_sig_width_mod_cusp;

	subtype shift_reg_d1ModifiedCusp_width      is std_logic_vector((SIZE_FILTER_DATA+7) downto 0);
	type shift_reg_d1ModifiedCusp_length        is array (lModifiedCusp downto 0) of shift_reg_d1ModifiedCusp_width;

	type data_latch_length_trapez               is array (5 downto 0) of data_latch_width;
end package;
